/**
 * @FileName Director.java
 * @Package builder
 * -------------------------------------
 * @function Please write description of function
 * @Date 2016-1-5 下午3:49:47
 * -------------------------------------
 * Copyright (c) 2016,顾博君 All Rights Reserved.
 */
package com.designMode.builder;

/**
 * @author 顾博君
 * @ClassName Director
 * @Date 2016-1-5 下午3:49:47
 * @Function 导演类
 */
public class Director {
    private Builder builder = new ConcreteBuilder();

    /**
     * 构建A产品，A产品需要功能1和功能2
     *
     * @return A产品
     */
    public Product getAProduct() {
        // 构建不同的产品
        builder.setPart1();
        builder.setPart2();
        return builder.builderProduct();
    }

    /**
     * 构建B产品，B产品需要功能2和功能3
     *
     * @return B产品
     */
    public Product getBProduct() {
        // 构建不同的产品
        builder.setPart2();
        builder.setPart3();
        return builder.builderProduct();
    }
}
